package mvc.command.character
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;

	import flash.display.DisplayObject;

	import iris.managers.IrisPopUpManager;

	import mx.containers.TabNavigator;
	import mx.core.Application;

	import view.design.DesignNewCharacter;

	public class AddCharacterCmd extends CharacterCmd implements ICommand
	{
		public function execute(event:CairngormEvent):void
		{
			var tabCharacters:TabNavigator = super._dsnCharacters.tabCharacters;
			
			var newCharacter:DesignNewCharacter = IrisPopUpManager.createPopUp(
				tabCharacters, DesignNewCharacter, true, null,
				IrisPopUpManager.LOCATE_PARENT_CENTER, IrisPopUpManager.EFFECT_BLUR) as DesignNewCharacter;
			newCharacter.oldIndex = event.data.oldIndex;
			newCharacter.width = tabCharacters.width - 20;
		}
	}
}